import React,{Component} from 'react'//
import { Route,Routes}  from 'react-router-dom'
import Login from './pages/login/login'
import Admin from './pages/admin/admin'


 

export default class App extends Component {

  constructor(props) {
    super(props)
    this.state = {
      coment: "初始值"
    }
  }

  changeA = (data) => {
    this.setState({
      coment: data
    })
  }

   
   render(){
         return(
          <div>
            <Routes>
              <Route path="/" exact={false} element={<div><Login changeA={this.changeA}/></div>} />
              <Route path="/admin/*" exact={false} element={<div><Admin coment={this.state.coment} /></div>} />
              <Route path="/login" exact={false} element={<div><Login changeA={this.changeA}  /></div>} />
            </Routes>
          </div>
                )
            }
        }